package com.itheima.reggie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.reggie.entity.User;
import com.itheima.reggie.mapper.UserMapper;
import com.itheima.reggie.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * <b><code>UserServiceImpl</code></b>
 * <p/>
 * Description
 * <p/>
 * <b>Creation Time:</b> 29/06/2024 19:00.
 *
 * @author yanjr
 * @since reggie_take_out
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    /**
     * 移动端登录
     * @param user 电话号码
     * @return 匹配的用户信息
     */
    @Override
    public User login(User user) {
        return baseMapper.selectOne(new LambdaQueryWrapper<User>().eq(User::getPhone, user.getPhone()));
    }
}
